package cn.yanxiaohui.service.web.pattern.proxy.cglib;

import net.sf.cglib.proxy.Enhancer;

/**
 * 测试动态代理
 * @author yanxh
 *
 */
public class Test {
	public static void main(String[] args) {
		TGP tgp = new TGP();
		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(CF.class);
		enhancer.setCallback(tgp);
		Game g = (Game) enhancer.create();
		g.play();

		enhancer.setSuperclass(LOL.class);
		Game g2 = (Game) enhancer.create();
		g2.play();
	}
}
